package com.emm.yixun.common.exception;


public enum XFUNExceptionCode {
	//系统异常 runtime exception
	UNKNOW_EXCEPTON("9999","未知异常","网络繁忙，请重试"),
	//参数验证错误DSAVerifyParameException
	ILLEGAL_PARAMETER("1000", "参数异常","参数异常"),
	
	USER_UNLOGIN("31000","会员未登陆","检测到您未登陆，请登录后继续操作！"),
	EDIT_USER_HEADTTPE_ERROR("30101","会员编辑图片类型不合法","会员编辑图片类型不合法！"),
	EDIT_USER_HEADPIC_FAIL("30102","会员编辑图片上传失败","会员编辑图片上传失败！"),
	EDIT_USER_HEADPIC_FILE("30102","会员编辑图片上传失败","会员编辑图片上传失败！"),
	USER_UNEXIST("31001","用户不存在","检测到您账号不存在，请开通账号后继续操作！"),
	USER_USERORPWDERROR("31002","用户名或密码错误","检测到您账号信息错误，请填写正确账号信息后继续操作！"),
	USER_PWDERROR("31003","原密码错误","检测到您账号密码错误，请填写正确账号密码后继续操作！"),
	USER_TOKENERROR("YUplf0wyU5vPVssLSG","请重新登录","检测到您账号token错误，请填写正确账号token后继续操作！"),
	USER_EDITPWDFAILURE("31005","用户密码修改失效","检测到您账号密码修改失败！"),
	UNMERCHANT("31006","商户未激活","商户未激活,请联系管理员！"),
	USER_FROZEN("31007","该用户已被禁用，启用需联系管理员！","检测到您账号已冻结！"),
	ROLE_PERMISSION_DENIED("31008","权限不足","检测到您权限不足！"),
	USER_CUSTOMERPHONEEXIST("31009","该手机号已经存在，请重新输入！","检测到您手机号已经存在！"),
	USER_PRODUCTNOEXIST("31010","该用户暂无项目数据权限，请联系管理员","检测到您无项目数据权限！"),
	USER_CUSTOMERNOEXIST("31011","该用户暂无客户数据权限，请联系管理员","检测到您暂无客户数据权限！"),
	USER_NOPROJECT("31012","该项目不存在，请重新登录","检测到项目不存在！"),
	USER_PERMISSION_CHANGES("108E65843mYuwqb01X","账号权限发生变动，请重新登录","检测到您账号权限发生变动，请重新登录后继续操作！"),
	
	UNRCAUDIT("32001","认筹审核失败","检测到您认筹审核失败！"),
	UNADDRCAUDIT("32002","认筹审核记录新增失败","检测到您认筹审核记录新增失败！"),
	UNRGAUDIT("32003","认购审核失败","检测到您认购审核失败！"),
	UNADDRGAUDIT("32004","认购审核记录新增失败","检测到您认购审核记录新增失败！"),
	UNQYAUDIT("32005","签约审核失败","检测到您签约审核失败！"),
	UNADDQYAUDIT("32006","签约审核记录新增失败","检测到您签约审核记录新增失败！"),
	NOSIGNEDDETAIL("32007","签约详情无记录","检测到您签约详情无记录！"),
	NOADDSIGNED("32008","新增签约失败","检测到您新增签约失败！"),
	NOADDSIGNEDPAY("32009","新增签约应付款失败","检测到您新增签约应付款失败！"),
	NOADDSIGNEDFAMILYMEMBER("32010","新增签约家庭成员失败","检测到您新增签约家庭成员失败！"),
	NODELSIGNEDPAY("32011","删除签约应付款失败","检测到您删除签约应付款失败！"),
	NODELSIGNEDFAMILYMEMBER("32010","删除签约家庭成员失败","检测到您删除签约家庭成员失败！"),
	
	;


	
	private XFUNExceptionCode(String code, String desin, String desout) {
		this.code = code;
		this.desin = desin;
		this.desout = desout;
	}
	
	private String code;
	private String desin;
	private String desout;
	
	public String getCode() {
		return code;
	}
	public String getDesin() {
		return desin;
	}
	public String getDesout() {
		return desout;
	}
	
	public static XFUNExceptionCode getByCode(String code) {
		if(code!=null&&!"".equals(code.trim())){
			for (XFUNExceptionCode mnum : values()) {
				if (mnum.getCode().equals(code)) {
					return mnum;
				}
			}
		}
		return null;
	}
	
	public static String getInMsg(String code) {
		if(code!=null&&!"".equals(code.trim())){
			for (XFUNExceptionCode mnum : values()) {
				if (mnum.getCode().equals(code)) {
					return mnum.getDesin();
				}
			}
		}
		return null;
	}
	
	public static String getOutMsg(String code) {
		if(code!=null&&!"".equals(code.trim())){
			for (XFUNExceptionCode mnum : values()) {
				if (mnum.getCode().equals(code)) {
					return mnum.getDesout();
				}
			}
		}
		return null;
	}
}
